#include<iostream>
using namespace std;
int main(){
	int word,digit,space,other,i,n;
	char text[100];
	word=digit=space=other=0;
	gets(text);
	for(i=0;i<100&&text[i]!='\0';i++)
	{
		if(text[i]>='A'&&text[i]<='Z') word++;
		else if(text[i]>='a'&&text[i]<='z') word++;
		else if(text[i]>='0'&&text[i]<='9') digit++; 
		else if(text[i]==' ') space++;
		else other++;
	}
    printf("word:%d digit:%d space:%d other:%d\n",word,digit,space,other); 
	return 0;
}
